/**	
 * Author : Mht
 * Desc : For 2016 RDM 
 */
package schedule.impl;

import org.quartz.DisallowConcurrentExecution;
import org.quartz.JobDataMap;
import org.quartz.JobExecutionContext;
import org.quartz.PersistJobDataAfterExecution;
import org.springframework.stereotype.Service;

import entity.schedule.ScheduleJob;
import lombok.extern.log4j.Log4j;
import schedule.AbstractQuartzJobFactory;

/**
 * @author Mht
 * @date Jun 2, 2016
 */
@Log4j
@Service
@DisallowConcurrentExecution
@PersistJobDataAfterExecution
public class JobTest extends AbstractQuartzJobFactory {

	/*
	 * (non-Javadoc)
	 * 
	 * @see schedule.IJob#exec1()
	 */
	@Override
	public void exec1(JobExecutionContext context) {
		// TODO Auto-generated method stub
		JobDataMap jobDataMap = context.getMergedJobDataMap();
		ScheduleJob scheduleJob = (ScheduleJob) context.getMergedJobDataMap().get("scheduleJob");
		log.info("现在正在执行第一个方法");
		log.info(scheduleJob.getJobName() + "任务执行情况为:" + scheduleJob.toString());
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see schedule.IJob#exec2()
	 */
	@Override
	public void exec2(JobExecutionContext context) {
		// TODO Auto-generated method stub
		JobDataMap jobDataMap = context.getMergedJobDataMap();
		ScheduleJob scheduleJob = (ScheduleJob) context.getMergedJobDataMap().get("scheduleJob");
		log.info("现在正在执行第二个方法");
		log.info(scheduleJob.getJobName() + "任务执行情况为:" + scheduleJob.toString());
	}

}
